<h1>Listing patients</h1>

<table>
  <tr>
    <th>Name</th>
    <th>Phone number</th>
    <th>Date died</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @patients.each do |patient| %>
  <tr>
    <td><%= patient.name %></td>
    <td><%= patient.phone_number %></td>
    <% if patient.deceased %>
      <td><%= patient.date_died %></td>
    <% else %>
      <td>Still alive</td>
    <% end %>
    <td><%= link_to 'Show', patient %></td>
    <td><%= link_to 'Edit', edit_patient_path(patient) %></td>
    <td><%= link_to 'Destroy', patient, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New Patient', new_patient_path %>
